<template>
	<view>
		<u-navbar :autoBack="true" leftIconColor="white" title="Migou" :placeholder="true" bgColor="#3ACD90"  :titleStyle="{ color: '#FFFFFF', fontSize: '40rpx' }"></u-navbar>
		
		<view class="cell-box-center" v-for="item in list" @click="checkMsg(item.message_id)">
			<view class="mtlr30 cell-box" style="display: flex;justify-content: space-between;">
				<view class="fbold">{{item.content}}</view>
				
			</view>
			
			<view class="mtlr30 cell-box" style="font-size:24rpx;display: flex;justify-content: space-between;">
				<view>创建时间: {{item.create_time}}</view>
				
			</view>
		</view>
		
	</view>
</template>

<script>
	import {
		noticeTypeList,
		readNotice,
		readNoticeAll
	} from "@/common/apis/user.js"
	
	export default {
		data() {
			return {
				list:[]
			};
		},
		onLoad(options) {
			console.log(options)
			let type = options.type
			noticeTypeList({type_id:type}).then(res=>{
				console.log('res',res)
				if(res.status == 200){
					this.list = res.data.list
				}
			})
		},
		methods:{
			checkMsg(mesasge_id){
				readNotice({mesasge_id:mesasge_id}).then( res=>{
					console.log('res',res)
				})
			}
		}
	}
</script>

<style scoped>
	.cell-box-first{
		padding: 20rpx 20rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	
	.cell-box-center{
		background-color: #ffffff;
		margin-top:30rpx;
		border-radius:20rpx ;
	}
	.cell-box{
		padding: 10rpx;
		display: flex;
		align-items: center;
	}
	.cell-box-title{
		margin-left:30rpx;
		font-size:30rpx
	}
	.cell-box-center-inner{
		background-color: #ffffff;
		margin-top:30rpx;
		border-radius:20rpx ;
	}
	
	.center-second{
		margin-top: 20rpx;
		background-color: #ffffff;
		border-radius: 20rpx;
		padding-bottom: 40rpx;
	}
	
	.vertical-divider {
		width: 100%;
		height: 2rpx;
		background-color: #D8D8D8;
	
	}
	.tagtitle {
		background-color: #ffffff;
		padding: 20rpx;
	}
</style>